package com.qdsg.modulesihealsdk.entity;

import static com.qdsg.modulesihealsdk.utils.SihealSdkConstant.SPO2_P_TYPE_1;

import com.siheal.entitys.measure.BloodOxygenEntity;

/**
 * @Description
 * @Author WuJianFeng
 * @Date 2022/12/9 17:40
 */
public class Spo2ResultEntity extends BaseMeasureEntity {
    private BloodOxygenEntity Spo2Entity;
    //1: 血氧 2: 脉率
    private int detectType;

    public Spo2ResultEntity(BloodOxygenEntity Spo2Entity, int detectType){
        this.Spo2Entity = Spo2Entity;
        this.detectType = detectType;
    }

    public BloodOxygenEntity getSpo2Entity() {
        return Spo2Entity;
    }

    public void setSpo2Entity(BloodOxygenEntity spo2Entity) {
        this.Spo2Entity = spo2Entity;
    }

    @Override
    public String getDetectResult(){

        if (Spo2Entity == null){
            return "";
        }
        if (detectType == SPO2_P_TYPE_1){
            //血氧
            return String.valueOf(Spo2Entity.getOxygenValue());
        }else {
            //脉率
            return String.valueOf(Spo2Entity.getPulseValue());
        }
    }
}
